Summary of Core Printing Features
Constants and Data Types
Gestalt Selectors for Printing
#define gestaltGXPrintingMgrVersion 'pmgr' #define gestaltGXVersion 'qdgx'QuickDraw GX Printing-Related Objects
/* printing-related object structures */ typedef struct gxPrivateJobRecord *gxJob; /* job object structure */ typedef struct gxPrivatePrinterRecord *gxPrinter; /* printer object */ /* structure */ typedef struct gxPrivateFormatRecord *gxFormat; /* format object */ /* structure */ typedef struct gxPrivatePaperTypeRecord *gxPaperType;/* paper-type object */ /* structure */ typedef struct gxPrivatePrintFileRecord *gxPrintFile;/* print file object */ /* structure */ typedef struct PrivateCollectionRecord *Collection;/* collection object */ /* structure */Edit Menu Record Structure
typedef struct { /* location of Edit menu and its menu items */ short editMenuID; /* resource ID of the Edit menu */ short cutItem; /* location of the cut menu item */ short copyItem; /* location of the copy menu item */ short pasteItem; /* location of the paste menu item */ short clearItem; /* location of the clear menu item */ short undoItem; /* location of the undo menu item */ } gxEditMenuRecord;Dialog Box Results
typedef long gxDialogResult; /* dialog result data type */ /* dialog box result enumeration */ enum { gxCancelSelected = (gxDialogResult) 0,/* user canceled dialog box */ gxOKSelected = (gxDialogResult) 1,/* user confirmed dialog box */ gxRevertSelected = (gxDialogResult) 2 /* user chose Remove from the Custom Page Setup dialog box */ };Functions
Initializing and Terminating QuickDraw GX Printing Features
OSErr GXInitPrinting(void); OSErr GXExitPrinting(void);Handling Errors
OSErr GXGetJobError(gxJob aJob); void GXSetJobError(gxJob aJob, OSErr anError);Creating and Managing Job Objects
OSErr GXNewJob(gxJob *aJob); OSErr GXDisposeJob(gxJob aJob); Handle GXFlattenJobToHdl(gxJob aJob, Handle aHandle); void GXFlattenJob(gxJob aJob, gxPrintingFlattenProc aPrintingFlattenProc, void *aVoid); gxJob GXUnflattenJobFromHdl(gxJob aJob, Handle aHandle); gxJob GXUnflattenJob(gxJob aJob, gxPrintingFlattenProc aPrintingFlattenProc, void *aVoid); Boolean GXUpdateJob (gxJob aJob);Printing With QuickDraw GX
void GXSelectJobOutputPrinter (gxJob aJob, Str31 printerName); void GXGetJobPageRange(gxJob aJob, long *firstPage, long *lastPage); void GXStartJob(gxJob aJob, StringPtr docName, long pageCount); void GXPrintPage(gxJob aJob, long pageNumber, gxFormat aFormat, gxShape aPage); void GXFinishJob(gxJob aJob); Boolean GXStartPage(gxJob aJob, long pageNumber, gxFormat aFormat, long numViewPorts, gxViewPort *viewPortList); void GXFinishPage(gxJob aJob);Obtaining Information on Printing-Related Objects
gxFormat GXGetJobFormat(gxJob aJob, long whichFormat); gxJob GXGetFormatJob(gxFormat aFormat); void GXGetFormatDimensions(gxFormat aFormat, gxRectangle *pageSize, gxRectangle *paperSize);Displaying the Page Setup and Print Dialog Boxes
void GXInstallApplicationOverride (gxJob, aJob, short messageID, void *override); gxDialogResult GXJobDefaultFormatDialog (gxJob aJob, gxEditMenuRecord *anEditMenuRecord); gxDialogResult GXJobPrintDialog (gxJob aJob, gxEditMenuRecord *anEditMenuRecord);Converting a Print Record
void GXConvertPrintRecord(gxJob aJob, THPrint aPrint);Application-Defined Functions
Message Override Functions
OSErr GXPrintingEvent(EventRecord *anEventRecord, Boolean filterEvent);Flattening and Unflattening Functions for Job Objects
OSErr MyFlattenFunction(long size, void *data, void *refCon); OSErr MyUnflattenFunction(long size, void *data, void *refCon);
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help